import request from '@/utils/request'
import qs from 'qs'

export const getCustomerList = (data) => {
  const querydata = qs.stringify(data)
  return request({
    url: `/crm-service/app/customer/list?${querydata}`,
    method: 'get'
  })
}

export const customerStorage = (row) => {
  return request({
    url: '/crm-service/app/customer/submit',
    method: 'post',
    data: row
  })
}

export const customerUpdate = (row) => {
  return request({
    url: '/crm-service/app/customer/update',
    method: 'post',
    data: row
  })
}

export const getCustomerInfo = (key) => {
  return request({
    url: `/crm-service/third/customer/search?searchName=${key}`,
    method: 'get'
  })
}

export const getCustomerBaseInfo = (id) => {
  return request({
    url: '/crm-service/app/customer/detail',
    method: 'get',
    params: {
      id
    }
  })
}


// 获取用户信息（接入企查查）
export const detailInformationByCustomerId = (customerId) => {
  return request({
    url: '/crm-service/customerInformation/detailByCustomerId',
    method: 'get',
    params: {
      customerId
    }
  })
}


